var Connector = {
	connection: null,
	
	connect: function(document, url, jid, password) {
		var conn = new Strophe.Connection(url);

		conn.connect(jid, password, function(status) {
			if (status == Strophe.Status.CONNECTED) {
				$(document).trigger('connected');
			}
			else if (status == Strophe.Status.DISCONNECTED) {
				$(document).trigger('disconnected');
			}
		});

		Connector.connection = conn;
	}
};


